package com.jintoufs.service.trade.impl;

import com.jintoufs.dao.baseinfo.TradeDAO;
import com.jintoufs.domain.baseinfo.Trade;
import com.jintoufs.domain.trade.Withdraw;
import com.jintoufs.service.trade.CoinwTradeService;
import com.jintoufs.service.trade.TradeService;
import org.cosmos.modules.web.msg.AjaxMsg;
import org.springframework.stereotype.Repository;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

/**
 * @author xiaoemo
 */
@Repository
public class TradeServiceImpl implements TradeService {
    @Resource
    private TradeDAO tradeDAO;
    @Resource
    private CoinwTradeService coinwTradeService;

    @Override
    public AjaxMsg trade(Trade trade, String siteName) {
        AjaxMsg ajaxMsg = new AjaxMsg();
        switch (siteName) {
            case "coinw":
                ajaxMsg = coinwTradeService.coinwTrade(trade);
        }
        return ajaxMsg;
    }

    @Override
    public AjaxMsg withdraw(Withdraw withdraw) {
        return null;
    }

    @Override
    public List<Map<String, Object>> queryByParams(Map params) {
        return tradeDAO.queryByParams(params);
    }
}
